package com.example.yunbiji0314.dao;

import com.example.yunbiji0314.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {

    //注册
    @Insert("insert into t_user(username,password) values (#{username},#{password})")
    int register(User user);

    //登录
    @Select("select * from t_user where username = #{username} ")
    User login(String name);

    //根据用户id，修改头像
    @Insert("update t_user set user_pic = #{userPic} where id = #{id}")
    int saveupload(User user);

    //根据用户id，修改密码
    @Update("update t_user set password = #{password} where id = #{id}")
    int savepassword(User user);

    //根据用户id，修改用户信息
    @Update("update t_user set nickname = #{nickname},email = #{email} where id = #{id}")
    int saveinfo(User user);
}
